// 发送手机验证码
$('#sendCode').click(function () {
  var flag = true;
  var regPhone = $("#phone").val();
  if (regPhone == null || regPhone == "") {
    alert("请输入手机号！");
    flag = false;
    return;
  } else if (!/^1[34578]\d{9}$/.test(regPhone)) {
    alert("手机格式错误，请重新输入！");
    flag = false;
    return;
  }

  sendCodeAjax();
  if (flag) {
    var $this = $(this),
      _this = this,
      i = 60;
    _this.disabled = 'disabled';
    clearInterval(repeat);
    var repeat = setInterval(function () {
      i--;
      if (i == 0) {
        _this.disabled = false;
        $this.html('发送验证码');
        $this.css('color', '#ff892f');
        clearInterval(repeat);
      } else {
        $this.html(i + 's后重新获取');
        $this.css('color', '#aba9a9');
      }
    }, 1000);


  }
});